//
//  KuKu_Device.swift
//  kuku
//
//  Created by 清风徐来 on 2024/1/27.
//

import UIKit
import Foundation

@objc open class KuKu_Device: NSObject {

    @objc public static func getAppDeviceModel() -> String {
        var systemInfo = utsname()
        uname(&systemInfo)
        let machineMirror = Mirror(reflecting: systemInfo.machine)
        let deviceModel = machineMirror.children.reduce("") { identifier, element in
            guard let value = element.value as? Int8, value != 0 else { return identifier }
            return identifier + String(UnicodeScalar(UInt8(value)))
        }
        return deviceModel
    }

    @objc public static func getAppDeviceOsVersion() -> String {
        let osVersion = UIDevice.current.systemVersion
        return osVersion
    }

}
